package com.ciaojian.client.controller;

import com.ciaojian.client.service.RosterServiceImpl;
import com.ciaojian.core.util.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author Atlakyn
 */
@Api(tags = "排班")
@RestController
@RequestMapping("/rosters")
public class RosterController {
    @Resource
    private RosterServiceImpl rosterService;

    @ApiOperation("门店排班时间表")
    @GetMapping("/store")
    public Result getByStoreId(Integer storeId) {
        Assert.notNull(storeId, "门店id不能为空");
        return Result.ok(rosterService.findByStoreId(storeId));
    }
}
